import request from '@/config/axios'
import type { Dayjs } from 'dayjs'

/** 系统配置信息 */
export interface RecipeConfig {
  id: number // 编号
  userIds?: string // 审核人员
  userNames?: string // 审核人员姓名
  sort?: number // 排序
  status?: number // 状态
}

// 系统配置 API
export const RecipeConfigApi = {
  // 查询系统配置分页
  getRecipeConfigPage: async (params: any) => {
    return await request.get({ url: `/school/recipe-config/page`, params })
  },

  // 查询系统配置详情
  getRecipeConfig: async () => {
    return await request.get({ url: `/school/recipe-config/get` })
  },

  // 新增系统配置
  createRecipeConfig: async (data: RecipeConfig) => {
    return await request.post({ url: `/school/recipe-config/create`, data })
  },

  // 修改系统配置
  updateRecipeConfig: async (data: RecipeConfig) => {
    return await request.put({ url: `/school/recipe-config/update`, data })
  },

  // 删除系统配置
  deleteRecipeConfig: async (id: number) => {
    return await request.delete({ url: `/school/recipe-config/delete?id=` + id })
  },

  /** 批量删除系统配置 */
  deleteRecipeConfigList: async (ids: number[]) => {
    return await request.delete({ url: `/school/recipe-config/delete-list?ids=${ids.join(',')}` })
  },

  // 导出系统配置 Excel
  exportRecipeConfig: async (params) => {
    return await request.download({ url: `/school/recipe-config/export-excel`, params })
  }
}
